This invention relates to a technique for compressing image data obtained by reading an image on a document and decompressing the image data into the original image data when forming an image on a recording medium.
Conventionally, an image forming apparatus wherein image data obtained by reading an image on a document is MR (Modified Relative Element Address Designate) encoded, once stored in a memory, and then decompressed into the original image data when forming an image on a sheet of paper has been known.
More specifically, in the image forming apparatus, image data of a line first read from the document among image data on the document is stored in the memory without being compressed. On the other hand, as for image data of each line after the first-read line, only the difference data from image data of the preceding line which has been read prior to each line is stored in the memory.
When forming an image on a sheet of paper, the non-compressed image data (the image data of the first-read line) is read out to a buffer area so as to form an image on the sheet of paper, and then the difference data is overwritten in sequence on the buffer area, thereby an image is formed on the sheet of paper while the image data of other lines is sequentially decompressed into the original image data.
In the case where an image is formed on one side of a sheet of paper and then another image is formed on the other side of the sheet of paper, generally not only are the sides of the paper flipped, but also the orientation of the sheet of paper with respect to a conveying direction is reversed. Therefore, the image needs to be formed in the inverse order to the order of reading images as relates to the other side.
In this case, the image forming apparatus as described above stores only the difference data except for the first-read line. Consequently, the compressed image data cannot be decompressed in the inverse order to the read order.
Therefore, an image forming apparatus has been invented wherein image data of an image to be formed on a sheet of paper in the read order is MR encoded and stored in a memory while image data of an image to be formed on the sheet of paper in the inverse order to the read order is stored in the memory without being compressed.